<?php
namespace Service\Controller;
use Think\Controller;
class QcodeController extends Controller {
	public function index(){
		$sessionKey = I("sessionKey");
		$shop_uid = I("shop_uid");
		$gid = I("gid");
		$sid = I("sid");
		$getway = I("getway");
		Vendor("taobaosdk.top.TopClient");
		Vendor('taobaosdk.lotusphp_runtime.Logger.Logger');
		Vendor("taobaosdk.top.RequestCheckUtil");
		Vendor('taobaosdk.top.request.MaQrcodeCommonCreateRequest');
		
		$c =  new \TopClient();
		$c->appkey = C("SM_KEY");
		$c->secretKey = C("SM_SECRET");
		$req = new \MaQrcodeCommonCreateRequest;
		$req->setType("url");
		$req->setContent(C("URL")."?m=shoptaemob&a=taepc_friendshow&sid=".$sid."&shop_uid=".$shop_uid."&gid=".$gid."&getway=".$getway);
		$req->setName("多麦抽奖");
		$req->setChannelName("移动端装修");
		$req->setStyle("EF4F2B");
		$req->setSize("300");
		$req->setNeedEps("false");
		$req->setLogo("http://img01.taobaocdn.com/imgextra/T1Od8YFT8eXXXXXXXX");
		$resp = $c->execute($req, $sessionKey);
		$this->ajaxReturn($resp);
	}
}